-- Demonstrate recursive types.

data List a = Cons a (List a)
            | Nil
              deriving (Show)

-- Pre exercise 1.
fromList (x:xs) = Cons x (fromList xs)
fromList [] = Nil

toList (Cons x xs) = x:(toList xs)
toList Nil = []


